<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="messages.Message" %>
<%@ page import="debug.*" %>
<%
	Dbg.print(request);
	ArrayList<Message> list =
				(ArrayList<Message>)request.getAttribute("list");
	int max = (Integer)request.getAttribute("max");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="css/style.css" rel="stylesheet" type="text/css">
		<link href="css/list.css" rel="stylesheet" type="text/css">
		<title>メッセージ一覧</title>
	</head>
	<body>
			<div id="aaa">
				<a href="entry.jsp" class="button">投稿</a>
			</div>			
			<% for ( int i=0 ; i<list.size() ; i++ ) { %>
			<% 	Message m = list.get( i ); %>
			<p>
				<div class="account" style="display: inline-block; _display: inline;">
					No.<%=m.getId() %>&nbsp名前:<%= m.getAccount() %>
				</div>
				<div class="regist_at" style="display:inline;">
					<%= m.getRegist_at() %>
				</div>
				<div class="message">
					<%= m.getMessage().replaceAll("\n", "<br />") %>
				</div>
				<div class="delete">
					<a href="EditServlet?id=<%= m.getId() %>">変更</a>
				</div>
				<div class="UserAgent">
					<%= m.getUserAgent()%>
				</div>
			</p>
			<hr />
				
			<% } %>
			
		
		<%
		int s = 0;
		while (s < max ) {
			out.print("<a href='ListServlet?start=" + s +"'>");
			out.print(1+ s/5);
			out.println("</a>&nbsp;");
			s += 5;
		}
		%>
	</body>
</html>